<?php class Eventstravel { 

    /***
     * DB Fields: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $id;

    /***
     * DB Fields: CargoM
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $CargoM;

    /***
     * DB Fields: CargoC
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $CargoC;

    /***
     * DB Fields: CargoD
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $CargoD;

    /***
     * DB Fields: Origin
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $Origin;

    /***
     * DB Fields: Target
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $Target;

    /***
     * DB Fields: Returning
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $Returning;

    /***
     * DB Fields: UserId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $UserId;

    /***
     * DB Fields: OriginP
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $OriginP;

    /***
     * DB Fields: TargetP
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $TargetP;

    /***
     * DB Fields: Type
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $Type;

    /***
     * DB Fields: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $EventName;

    /***
     * DB Fields: departedTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $departedTime;

    /***
     * DB Fields: travelTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $travelTime;

    /***
     * DB Fields: cancelled
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $cancelled;

    /***
     * DB Fields: arriveTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $arriveTime;

//--------------- GET METHODS ----------------------------- //
    /***
     * Get value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result id
     **/
    function get_id( ) {
        // returns the value of id
        return $this->id;
    }


    /***
     * Get value for field: CargoM
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result CargoM
     **/
    function get_CargoM( ) {
        // returns the value of CargoM
        return $this->CargoM;
    }


    /***
     * Get value for field: CargoC
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result CargoC
     **/
    function get_CargoC( ) {
        // returns the value of CargoC
        return $this->CargoC;
    }


    /***
     * Get value for field: CargoD
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result CargoD
     **/
    function get_CargoD( ) {
        // returns the value of CargoD
        return $this->CargoD;
    }


    /***
     * Get value for field: Origin
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result Origin
     **/
    function get_Origin( ) {
        // returns the value of Origin
        return $this->Origin;
    }


    /***
     * Get value for field: Target
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result Target
     **/
    function get_Target( ) {
        // returns the value of Target
        return $this->Target;
    }


    /***
     * Get value for field: Returning
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result Returning
     **/
    function get_Returning( ) {
        // returns the value of Returning
        return $this->Returning;
    }


    /***
     * Get value for field: UserId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result UserId
     **/
    function get_UserId( ) {
        // returns the value of UserId
        return $this->UserId;
    }


    /***
     * Get value for field: OriginP
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result OriginP
     **/
    function get_OriginP( ) {
        // returns the value of OriginP
        return $this->OriginP;
    }


    /***
     * Get value for field: TargetP
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result TargetP
     **/
    function get_TargetP( ) {
        // returns the value of TargetP
        return $this->TargetP;
    }


    /***
     * Get value for field: Type
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result Type
     **/
    function get_Type( ) {
        // returns the value of Type
        return $this->Type;
    }


    /***
     * Get value for field: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result EventName
     **/
    function get_EventName( ) {
        // returns the value of EventName
        return $this->EventName;
    }


    /***
     * Get value for field: departedTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result departedTime
     **/
    function get_departedTime( ) {
        // returns the value of departedTime
        return $this->departedTime;
    }


    /***
     * Get value for field: travelTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result travelTime
     **/
    function get_travelTime( ) {
        // returns the value of travelTime
        return $this->travelTime;
    }


    /***
     * Get value for field: cancelled
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result cancelled
     **/
    function get_cancelled( ) {
        // returns the value of cancelled
        return $this->cancelled;
    }


    /***
     * Get value for field: arriveTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result arriveTime
     **/
    function get_arriveTime( ) {
        // returns the value of arriveTime
        return $this->arriveTime;
    }


//--------------- SET METHODS ----------------------------- //
    /***
     * Set value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function set_id( $id ) {
        // sets the value of id
        $this->id = $id;
    }

    /***
     * Set value for field: CargoM
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param CargoM
     * @result void
     **/
    function set_CargoM( $CargoM ) {
        // sets the value of CargoM
        $this->CargoM = $CargoM;
    }

    /***
     * Set value for field: CargoC
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param CargoC
     * @result void
     **/
    function set_CargoC( $CargoC ) {
        // sets the value of CargoC
        $this->CargoC = $CargoC;
    }

    /***
     * Set value for field: CargoD
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param CargoD
     * @result void
     **/
    function set_CargoD( $CargoD ) {
        // sets the value of CargoD
        $this->CargoD = $CargoD;
    }

    /***
     * Set value for field: Origin
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param Origin
     * @result void
     **/
    function set_Origin( $Origin ) {
        // sets the value of Origin
        $this->Origin = $Origin;
    }

    /***
     * Set value for field: Target
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param Target
     * @result void
     **/
    function set_Target( $Target ) {
        // sets the value of Target
        $this->Target = $Target;
    }

    /***
     * Set value for field: Returning
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param Returning
     * @result void
     **/
    function set_Returning( $Returning ) {
        // sets the value of Returning
        $this->Returning = $Returning;
    }

    /***
     * Set value for field: UserId
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param UserId
     * @result void
     **/
    function set_UserId( $UserId ) {
        // sets the value of UserId
        $this->UserId = $UserId;
    }

    /***
     * Set value for field: OriginP
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param OriginP
     * @result void
     **/
    function set_OriginP( $OriginP ) {
        // sets the value of OriginP
        $this->OriginP = $OriginP;
    }

    /***
     * Set value for field: TargetP
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param TargetP
     * @result void
     **/
    function set_TargetP( $TargetP ) {
        // sets the value of TargetP
        $this->TargetP = $TargetP;
    }

    /***
     * Set value for field: Type
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param Type
     * @result void
     **/
    function set_Type( $Type ) {
        // sets the value of Type
        $this->Type = $Type;
    }

    /***
     * Set value for field: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param EventName
     * @result void
     **/
    function set_EventName( $EventName ) {
        // sets the value of EventName
        $this->EventName = $EventName;
    }

    /***
     * Set value for field: departedTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param departedTime
     * @result void
     **/
    function set_departedTime( $departedTime ) {
        // sets the value of departedTime
        $this->departedTime = $departedTime;
    }

    /***
     * Set value for field: travelTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param travelTime
     * @result void
     **/
    function set_travelTime( $travelTime ) {
        // sets the value of travelTime
        $this->travelTime = $travelTime;
    }

    /***
     * Set value for field: cancelled
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param cancelled
     * @result void
     **/
    function set_cancelled( $cancelled ) {
        // sets the value of cancelled
        $this->cancelled = $cancelled;
    }

    /***
     * Set value for field: arriveTime
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param arriveTime
     * @result void
     **/
    function set_arriveTime( $arriveTime ) {
        // sets the value of arriveTime
        $this->arriveTime = $arriveTime;
    }

//--------------- CRUD METHODS ----------------------------- //
    /***
     * Create a new Record: eventstravel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param CargoM
     * @param CargoC
     * @param CargoD
     * @param Origin
     * @param Target
     * @param Returning
     * @param UserId
     * @param OriginP
     * @param TargetP
     * @param Type
     * @param EventName
     * @param departedTime
     * @param travelTime
     * @param cancelled
     * @param arriveTime
     * @result void
     **/
    function createnew_eventstravel( $id, $CargoM, $CargoC, $CargoD, $Origin, $Target, $Returning, $UserId, $OriginP, $TargetP, $Type, $EventName, $departedTime, $travelTime, $cancelled, $arriveTime ) {

        // items to be inserted in the database 
        $_obj = array($id,
                      $CargoM,
                      $CargoC,
                      $CargoD,
                      $Origin,
                      $Target,
                      $Returning,
                      $UserId,
                      $OriginP,
                      $TargetP,
                      $Type,
                      $EventName,
                      $departedTime,
                      $travelTime,
                      $cancelled,
                      $arriveTime); 

        // database object connection
        $dbConn = $GLOBALS['dbConn'];

        // perform insert in the database
        $dbConn->insert("eventstravel", $_obj);
    }

    /***
     * Retrived an existing record: eventstravel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result new Eventstravel
     **/
    function get_eventstravel( $id ) {

        // retrive the data
        $dbConn = $GLOBALS['dbConn'];

        // retrieved value in the database
        $_resultSet = $dbConn->doQuery("SELECT * FROM eventstravel WHERE id = '$id'");

        $__eventstravelObj = new eventstravel();
        // return the retrived from the database

        // create a new object
        $__obj = new Eventstravel();
        $__obj->set_id($_resultSet[0]['id']);
        $__obj->set_CargoM($_resultSet[0]['CargoM']);
        $__obj->set_CargoC($_resultSet[0]['CargoC']);
        $__obj->set_CargoD($_resultSet[0]['CargoD']);
        $__obj->set_Origin($_resultSet[0]['Origin']);
        $__obj->set_Target($_resultSet[0]['Target']);
        $__obj->set_Returning($_resultSet[0]['Returning']);
        $__obj->set_UserId($_resultSet[0]['UserId']);
        $__obj->set_OriginP($_resultSet[0]['OriginP']);
        $__obj->set_TargetP($_resultSet[0]['TargetP']);
        $__obj->set_Type($_resultSet[0]['Type']);
        $__obj->set_EventName($_resultSet[0]['EventName']);
        $__obj->set_departedTime($_resultSet[0]['departedTime']);
        $__obj->set_travelTime($_resultSet[0]['travelTime']);
        $__obj->set_cancelled($_resultSet[0]['cancelled']);
        $__obj->set_arriveTime($_resultSet[0]['arriveTime']);


        return $__obj;
    }

    /***
     * Update an existing record: eventstravel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param itemsToBeUpdated = array()
     * @result void
     **/
    function update_eventstravel( $id, $itemsToBeUpdated = array() ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs update in the database
         foreach($itemsToBeUpdated as $_fName => $_fVal) { 
               $dbConn->addValuePair($_fName, $_fVal);
         }

         // perform update operation
         $dbConn->update("eventstravel", "id = '$id'");
    }

    /***
     * Delete an existing record: eventstravel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function delete_eventstravel( $id ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs deletion of data
         $dbConn->delete("eventstravel", "id = '$id'");
    }

    /***
     * Retrived list of objects base on a given parameters: eventstravel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param conditionalStatement = ''
     * @result collection of objects: Eventstravel
     **/
    function list_eventstravel( $conditionalStatement = '' ) {

         $dbConn = $GLOBALS['dbConn'];
         // check if there is a given parameter list
         if(!empty($conditionalStatement)) { 
              $sqlStatement = "SELECT * FROM eventstravel WHERE $conditionalStatement"; 
         } else { 
              $sqlStatement = "SELECT * FROM eventstravel";
         }

         // retrieve the values base on the query result
         $__resObj = $dbConn->doQuery($sqlStatement);

         $__collectionOfObjects = array();
         foreach($__resObj as $__rs) { 
            $__newObj = new Eventstravel();

            $__newObj->set_id($__rs['id']);
            $__newObj->set_CargoM($__rs['CargoM']);
            $__newObj->set_CargoC($__rs['CargoC']);
            $__newObj->set_CargoD($__rs['CargoD']);
            $__newObj->set_Origin($__rs['Origin']);
            $__newObj->set_Target($__rs['Target']);
            $__newObj->set_Returning($__rs['Returning']);
            $__newObj->set_UserId($__rs['UserId']);
            $__newObj->set_OriginP($__rs['OriginP']);
            $__newObj->set_TargetP($__rs['TargetP']);
            $__newObj->set_Type($__rs['Type']);
            $__newObj->set_EventName($__rs['EventName']);
            $__newObj->set_departedTime($__rs['departedTime']);
            $__newObj->set_travelTime($__rs['travelTime']);
            $__newObj->set_cancelled($__rs['cancelled']);
            $__newObj->set_arriveTime($__rs['arriveTime']);

            // add object to collection 
            array_push($__collectionOfObjects, $__newObj);
         }

         // return collection of objects
         return $__collectionOfObjects;
    }

} ?>